<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="${ctx}/css/main/base.css" rel="stylesheet" type="text/css"/>
<link href="${ctx}/css/main/main.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="${ctx}/scripts/commons/jquery-1.2.3.pack.js"></script>
<title></title>
<script type="text/javascript">
function checkForm(){
			setInfo("dicNoError","");
            setInfo("dicNameError","");
			var dicNo = document.getElementById("dic.dicNo").value;
			var dicName = document.getElementById("dic.dicName").value;
			

			if(dicNo.length == 0||Trim(dicNo)==""){
				setInfo("Noerror","请输入代码编号！");
				document.getElementById("dic.dicNo").focus();
				return false;
			}
            
            			
			if(dicName.length == 0){
				setInfo("Nameerr","请输入代码名称！");
				document.getElementById("dic.dicName").focus();
				return false;
			}
			return true;
			}
			
	function setInfo(field,info){
			document.getElementById(field).style.display = "block";
			document.getElementById(field).innerHTML = "<font color='red'>" + info + "</font>";
		}
		
		//此处为独立函数 
	function LTrim(str) 
	{ 
	var i; 
	for(i=0;i<str.length;i++) 
	{ 
		if(str.charAt(i)!=" "&&str.charAt(i)!=" ")break; 
	} 
		str=str.substring(i,str.length); 
		return str; 
	} 
	
	function RTrim(str) 
	{ 
	var i; 
		for(i=str.length-1;i>=0;i--) 
		{ 
		 if(str.charAt(i)!=" "&&str.charAt(i)!=" ")break; 
		} 
	str=str.substring(0,i+1); 
	return str; 
	} 
	
	
	function Trim(str) 
	{ 
		return LTrim(RTrim(str)); 
	} 
		

</script>
</head>
<body class="m_r">
<form action="${ctx}/code/code_dic_createNextLevelCode.action"  method="post" enctype="multipart/form-data" onsubmit="return checkForm()">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tab_m">
  <tr>
    <td colspan="2" class="zctop left"><span class="font14 zc_bt">添加自定义字典子分类</span></td>
  </tr>
  <tr>
    <td class="bg5 right">代码主分类名称：</td>
    <td><select name="dicNoParent" class="fl_l">
    	<s:iterator value="dics" status="dic">
         <option value="<s:property value="dicNo"></s:property>"
          <s:if test="dicId==selectNo"> selected </s:if> >
         <s:property value="dicName"></s:property></option>
   		 </s:iterator>
    </td>
  </tr>
  <tr>
    <td class="bg5 right">代码编号：</td>
    <td><input type="text" name="dic.dicNo" class="fl_l"/><div id="Noerror" class="fielderror"></div></td>
  </tr>
    <tr>
    <td class="bg5 right">代码名称：</td>
    <td><input type="text" name="dic.dicName" class="fl_l"/><div id="Nameerr" class="fielderror"></div></td>
  </tr>
   <tr>
    <td class="bg5 right">代码名称(英)：</td>
    <td><input type="text" name="dic.dicNameEn" class="fl_l"/></td>
  </tr>
  <tr>
    <td class="bg5 right">代码序号：</td>
    <td><input type="text" name="dic.dicOrder" class="fl_l"/></td>
  </tr>
  <tr>
    <td colspan="2" class="hei_1">
    <input  type="submit" value="提 交" class="log_f zc_b"/>
    <input  type="reset" value="返 回" class="log_f zc_b" onclick="javascript:history.go(-1)"/>	</td>
  </tr>
</table>
</form>
</body>
</html>